﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;

namespace DDNY.WebPortals.Common
{
    public class MyHttpUtil
    {
        public static string UrlEncode(string input)
        {
            string result = Regex.Replace(input, @"[\W]", " ");
            result = HttpUtility.UrlEncode(result);
            return result;
        }

        public static string UrlEncodeAdvanced(string input)
        {
            string result = input;
            result = Regex.Replace(input, @"[\W]", " ");
            result = result.Split(new char[]{' '})[0];
            result = HttpUtility.UrlEncode(result);
            return result;
        }
    }
}
